<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let second = +prompt("请输入秒数:")

        function getTime(second){
            let h = parseInt(second / 60 / 60 % 24)
            let m = parseInt(second / 60 % 60)
            let s = parseInt(second % 60)
            h = h > 10 ? h : '0' + h
            m = m > 10 ? m : '0' + m
            s = s > 10 ? s : '0' + s

            return `${second}秒转换:${h}小时${m}分${s}秒`
        }
        let str = getTime(second)
        document.write(str)
    </script>
</body>
</html>